package tests;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
import javax.swing.JFrame;

public class TestShowImage extends Panel {    
	private static final long serialVersionUID = 8160172478300881585L;
	BufferedImage  image;
	
    public TestShowImage() {
    	try {
    		String imageName="img/simple3.png";
    		File input = new File(imageName);
    		image = ImageIO.read(input);
    	} catch (IOException ie) {
    	System.out.println("Error:"+ie.getMessage());
    }
  }

  public void paint(Graphics g) {
    g.drawImage( image, 0, 0, null);
  }

  static public void main(String args[]) throws Exception {
    JFrame frame = new JFrame("Ray Tracer rendered image");
    Panel panel = new TestShowImage();
    frame.getContentPane().add(panel);
    frame.setSize(500, 500);
    frame.setVisible(true);
  }
} 